<?php
  /**
   * Kontrollbase
   *
   * An open source MySQL monitoring and analytics application
   *
   * @package Kontrollbase
   * @author Matt Reid
   * @copyright Copyright (c) 2009 Matt Reid, Kontrollbase LLC
   * @license http://kontrollsoft.com/kontrollbase/userguide/general-LICENSE.php
   * @link http://kontrollbase.com
   */

$nroot = substr_replace($root,"",-1);
$date = date("c"); 
$package_version = "0.8";

foreach($host as $key => $value) {
  foreach($value as $k => $v) {
    $$k = $v;
  }

  print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<kontrollcomm_host_command_template>
 <object name='Kontrollcomm - Server Command Automation Interface'/>
 <object website='http://kontrollsoft.com'/>
 <object access_path='$nroot/index.php/agent/request/$host_list_uuid'/>
 <object version='$package_version'/>
 <object copyright='Copyright 2010-present, Kontrollsoft LLC'/>
 <object license='BSD http://www.opensource.org/licenses/bsd-license.php'/>
 <object hostname=\"$host_list_hostname\"/>
 <object uuid=\"$host_list_uuid\"/>
 <object datetime='$date'/>";

  foreach($template as $key => $value) {
    foreach($value as $k => $v) {
      $$k = $v;
      //print "k: $$k, v: $v<br>";
    }
    print "
 <object command_object_command='$command_objects_command' command_object_desc='$command_objects_desc' command_object_name='$command_objects_name'/>";
  }
  print "
</kontrollcomm_host_command_template>
";
}

?>